package org.example.design.template.utils;

import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.IndexedColors;

/**
 * @author huangshen
 * @version 0
 * @description ExcelParamBean
 */
public class ExcelStyle {

    /**
     * 标题单元格高度
     */
    private int titleRowHeight = 500;

    /**
     * 列名单元格宽度
     */
    private int columnNameCellWidth = 5000;

    /**
     * 列名单元格高
     */
    private int columnNameCellHeight = 600;

    /**
     * 是否显示网格
     */
    private boolean isDisplayGrid = false;

    /**
     * 填充背景色
     */
    private int fillBackGroundColor = new HSSFColor.BLUE().getIndex();

    /**
     * 单元格背景色
     */
    private int fillForeGroundColor = new HSSFColor.BLUE().getIndex();

    /**
     * 填充样式 0 无填充 1 有填充
     */
    private int fillPattern = 1;

    /**
     * 是否显示网格线
     */
    private boolean isShowGridLine = true;

    /**
     * 左间距
     */
    private int leftMarginSize = 0;

    /**
     * 右间距
     */
    private int rightMarginSize = 0;

    /**
     * 字号
     */
    private int fontSize = 12;

    /**
     * 下边框距
     */
    private int cellBorderBottom = 1;

    /**
     * 左边框距
     */
    private int cellBorderLeft = 1;

    /**
     * 右边框距
     */
    private int cellBorderRight = 1;

    /**
     * 上边框距
     */
    private int cellBorderTop = 1;

    public int getTitleRowHeight() {
        return titleRowHeight;
    }

    public int getColumnNameCellWidth() {
        return columnNameCellWidth;
    }

    public int getColumnNameCellHeight() {
        return columnNameCellHeight;
    }

    public boolean isDisplayGrid() {
        return isDisplayGrid;
    }

    public int getFillBackGroundColor() {
        return fillBackGroundColor;
    }

    public int getFillForeGroundColor() {
        return fillForeGroundColor;
    }

    public int getFillPattern() {
        return fillPattern;
    }

    public boolean isShowGridLine() {
        return isShowGridLine;
    }

    public int getLeftMarginSize() {
        return leftMarginSize;
    }

    public int getRightMarginSize() {
        return rightMarginSize;
    }

    public int getFontSize() {
        return fontSize;
    }

    public int getCellBorderBottom() {
        return cellBorderBottom;
    }

    public int getCellBorderLeft() {
        return cellBorderLeft;
    }

    public int getCellBorderRight() {
        return cellBorderRight;
    }

    public int getCellBorderTop() {
        return cellBorderTop;
    }

    public ExcelStyle setTitleRowHeight(int titleRowHeight) {
        this.titleRowHeight = titleRowHeight;
        return this;
    }

    public ExcelStyle setColumnNameCellWidth(int columnNameCellWidth) {
        this.columnNameCellWidth = columnNameCellWidth;
        return this;
    }

    public ExcelStyle setColumnNameCellHeight(int columnNameCellHeight) {
        this.columnNameCellHeight = columnNameCellHeight;
        return this;
    }

    public ExcelStyle setDisplayGrid(boolean displayGrid) {
        isDisplayGrid = displayGrid;
        return this;
    }

    public ExcelStyle setFillBackGroundColor(int fillBackGroundColor) {
        this.fillBackGroundColor = fillBackGroundColor;
        return this;
    }

    public ExcelStyle setFillForeGroundColor(int fillForeGroundColor) {
        this.fillForeGroundColor = fillForeGroundColor;
        return this;
    }

    public ExcelStyle setFillPattern(int fillPattern) {
        this.fillPattern = fillPattern;
        return this;
    }

    public ExcelStyle setShowGridLine(boolean showGridLine) {
        isShowGridLine = showGridLine;
        return this;
    }

    public ExcelStyle setLeftMarginSize(int leftMarginSize) {
        this.leftMarginSize = leftMarginSize;
        return this;
    }

    public ExcelStyle setRightMarginSize(int rightMarginSize) {
        this.rightMarginSize = rightMarginSize;
        return this;
    }

    public ExcelStyle setFontSize(int fontSize) {
        this.fontSize = fontSize;
        return this;
    }

    public ExcelStyle setCellBorderBottom(int cellBorderBottom) {
        this.cellBorderBottom = cellBorderBottom;
        return this;
    }

    public ExcelStyle setCellBorderLeft(int cellBorderLeft) {
        this.cellBorderLeft = cellBorderLeft;
        return this;
    }

    public ExcelStyle setCellBorderRight(int cellBorderRight) {
        this.cellBorderRight = cellBorderRight;
        return this;
    }

    public ExcelStyle setCellBorderTop(int cellBorderTop) {
        this.cellBorderTop = cellBorderTop;
        return this;
    }

    @Override
    public String toString() {
        return "ExcelStyle{" +
                "titleRowHeight=" + titleRowHeight +
                ", columnNameCellWidth=" + columnNameCellWidth +
                ", columnNameCellHeight=" + columnNameCellHeight +
                ", isDisplayGrid=" + isDisplayGrid +
                ", fillBackGroundColor=" + fillBackGroundColor +
                ", fillForeGroundColor=" + fillForeGroundColor +
                ", fillPattern=" + fillPattern +
                ", isShowGridLine=" + isShowGridLine +
                ", leftMarginSize=" + leftMarginSize +
                ", rightMarginSize=" + rightMarginSize +
                ", fontSize=" + fontSize +
                ", cellBorderBottom=" + cellBorderBottom +
                ", cellBorderLeft=" + cellBorderLeft +
                ", cellBorderRight=" + cellBorderRight +
                ", cellBorderTop=" + cellBorderTop +
                '}';
    }
}
